<template>
  <div class="site-containner">
    <div class="app-container">
      <el-row>
        <el-col :span="24">
          <div class="outMore">
            <div class="dataTitle">
              详情
              <div class="returnIndex" @click="returnAll"><i class="el-icon-arrow-left titleIcon"></i>返回</div>
            </div>
          </div>
          <div>
            <div class="addBody">
              <div>
                <el-form :inline="true" class="addMessage" ref="form" :model="cycleLookData" label-width="125px">
                  <el-form-item label="设备编号:">
                    <el-input v-model="cycleLookData.equip_cid" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="设备名称:">
                    <el-input v-model="cycleLookData.equip_name" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="配件编码:">
                    <el-input v-model="cycleLookData.fittings_id" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="机构:">
                    <el-input v-model="cycleLookData.fittings_type_label" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="配件名称:">
                    <el-input v-model="cycleLookData.fittings_name" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="状态:">
                    <el-input v-model="cycleLookData.status" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="周期检查提醒:">
                    <el-input v-model="cycleLookData.cycle_remind" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item v-if="cycleLookData.cycle_thresholds_one" label="阈值系数1(%):">
                  <el-input v-model="cycleLookData.cycle_thresholds_one" class="smallMessage readonlyOne" readonly></el-input>
                </el-form-item>
                  <el-form-item v-if="cycleLookData.cycle_thresholds_two" label="阈值系数2(%):">
                    <el-input v-model="cycleLookData.cycle_thresholds_two" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item v-if="cycleLookData.cycle_thresholds_three" label="阈值系数3(%):">
                    <el-input v-model="cycleLookData.cycle_thresholds_three" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="累计次数/时间:">
                    <el-input v-model="cycleLookData.cumulative_num" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="发生时间:">
                    <el-input v-model="cycleLookData.remind_time" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="处理人:">
                    <el-input v-model="cycleLookData.handle_user_name" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="完成时间:">
                    <el-input v-model="cycleLookData.finish_time" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="处理结果:">
                    <el-input v-model="cycleLookData.result" class="smallMessage readonlyOne" readonly></el-input>
                  </el-form-item>
                </el-form>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
  import axios from 'axios'
  export default {
    data() {
      return {
        cycleLookData: {
          equip_cid: '',
          equip_name: '',
          fittings_id: '',
          fittings_type_label: '',
          fittings_name: '',
          status: '',
          cycle_remind: '',
          cycle_thresholds_one: '',
          cycle_thresholds_two: '',
          cycle_thresholds_three: '',
          cumulative_num: '',
          remind_time: '',
          handle_user_name: '',
          finish_time: '',
          result: ''
        },
        // 查看周期提醒详情
        cycleLookBody: {
          access_token: localStorage.getItem('access_token'),
          type: 'cycle_remind_get_byid',
          id: parseInt(this.$route.query.id)
        }
      }
    },
    created() {
      this.getOncecycle()
    },
    methods: {
      getOncecycle() {
        axios.post('/fittings', this.cycleLookBody, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          this.cycleLookData = res.data.data
          if (this.cycleLookData.status === 0) {
            this.cycleLookData.status = '未处理'
          } else {
            this.cycleLookData.status = '已处理'
          }
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      returnAll() {
        this.$router.push({
          path: '/monitor/components/reminder',
          query: {
            tabsNub: 'first'
          }
        })
      }
    }
  }
</script>
<style scoped>
  .site-containner{
    font-size: 16px;
    color: #25B6C7;
  }
  .outMore{
    height: 40px;
    padding-top: 2px;
    border-bottom: 1px solid #E0E0E0;
  }
  .dataTitle {
    padding-left: 5px;
    border-left: 5px solid #25B6C7;
    height: 16px;
    font-size: 16px;
    color: #323842;
  }
  .returnIndex {
    float: right;
    font-size: 14px;
    color: #25B6C7;
    cursor: pointer;
  }
  .addBody{
    width: 100%;
    margin-top: 20px;
    border: 1px solid #E0E0E0;
  }
  /deep/ .el-input__inner {
    height: 30px;
  }
  /deep/ .addMessage {
    padding: 10px 0px;
    width: 790px;
  }
  /deep/ .addMessageTwo {
    padding: 10px 0px;
    width: 930px;
  }
  /deep/ .time {
    border-bottom: 1px solid #E0E0E0;
  }
  .el-form-item {
    margin-bottom: 0px;
  }
  /deep/ .onlyLine {
    width: 100%;
  }
  /deep/ .el-radio {
    margin: 0px 5px;
  }
  /deep/ .bigMessage {
    width: 788px;
  }
  /deep/ .smallMessage {
    width: 256px;
  }
  /deep/ .theSmallMessage {
    width: 152px;
  }
  /deep/ .theSmallestMessage {
    width: 134px;
  }
  /deep/ .moreSmallMessage {
    width: 100px;
  }
  /deep/ .mostSmallMessage {
    width: 80px;
    margin-right: 5px;
  }

  /deep/ .indieWidth {
    padding: 6px 16px;
    float: right;
    border:1px solid #25B6C7;
    background: #25B6C7;
    margin-top: 20px;
  }
  /deep/ .readonlyOne > .el-input__inner {
    border: none;
  }
</style>
